<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background-color: pink;
        }

        .box2 {
            border: 2px solid skyblue;
        }

        .orange {
            border: 2px solid orange;
        }

        .red {
            border: 2px solid red;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="change('orange')">orange</button>
        <button @click="change('red')">red</button>
        <div class="box"></div>
        <div :class="className">div</div>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            // 定义数据
            data: {
                className: 'box2'
            },
            // 定义方法
            methods: {
                change(color) {
                    this.className = color
                }
            }
        })
    </script>
</body>
</html>